﻿<?php
/*
Template Name: HomePage
*/ 
?>
<?php get_header();?>
	<div id="message">
		<?php if(have_posts()):while(have_posts()): the_post() ?>
		<marquee SCROLLAMOUNT=5><a href="/wordpress/?page_id=2"><?php echo get_post_meta($post->ID,'tag',true);?></a></marquee>
		<?php endwhile; else:?>
			<p>Không có gì để show !</p>
		<?php endif;?>
	</div> <!-- #message-->
	<div id="homeWrapper">	
		<?php include(TEMPLATEPATH.'/imageSlider.php');?>
		<div id="newestPost">
			<h2>Bài viết nổi bật</h2>
			<img src="<?php echo bloginfo('stylesheet_directory');?>/images/special.png" alt="special post" class="header_specialpost"/>
			<?php 
			$blogPost = new WP_query();
			$blogPost->query('showposts=1');
			while($blogPost->have_posts()):$blogPost->the_Post();			
			?>
			<?php $thumb = get_post_meta($post->ID,'hình đại diện',true);?>		
			<img class="avatar_specialpost"src="<?php bloginfo('stylesheet_directory')?>/timthumb.php?src=<?php echo $thumb;?>&amp;h=120;&amp;w=120;zc=1" width="120" height="120"alt="avatar"/>
			<p class="showcomment"> lời bình</p>
			<span class="numpost"><?php comments_number('0', '1', '%' );?></span>
			<p class="content"><?php the_content_rss('&hellip',false,'',80);?></p>
			<a href="<?php the_permalink();?>">Xem ngay &hellip;</a>
			<?php endwhile;?>
		</div> <!-- end #newestPost-->
		<?php if(have_posts()):while(have_posts()): the_post() ?>
			<?php the_content('');?>
		<?php endwhile; else:?>
			<p>Không có gì để show !</p>
		<?php endif;?>	
	</div> <!-- end #homeWrapper-->
<?php get_footer();?>